package com.hxkj.client.service;

import com.hxkj.domain.po.Column;
import com.hxkj.domain.po.Navigation;
import com.hxkj.domain.po.NavigationTree;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
import java.util.Map;


/**
 * @author chenfangzhou
 * @create 2018-05-23 11:58
 * @desc 导航栏对外接口
 **/
@FeignClient(name = "cms-management")
public interface NavigationServiceClient {
    /**
     * 获取导航栏列表
     * @param navigation
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/getlist", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<NavigationTree>> getNavigationList(@RequestBody Navigation navigation) throws Exception;


    /**
     * 获取单个导航栏
     * @param navigation
     * @return 角色
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/get", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Navigation> getNavigation(@RequestBody Navigation navigation) throws Exception;


    /**
     * 新增导航栏
     * @param navigation
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/save", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct saveNavigation(@RequestBody Navigation navigation) throws Exception;


    /**
     * 删除导航栏
     * @param navigation
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/remove", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct deleteNavigation(@RequestBody Navigation navigation) throws Exception;


    /**
     * 更新导航栏
     * @param navigation
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/modify", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct updateNavigation(@RequestBody Navigation navigation) throws Exception;

    /**
     * 修改导航栏排序
     * @param map
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/modifyOrderId", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct modifyOrderId(@RequestBody Map<String, Object> map) throws Exception;

    /**
     * 获取导航栏列表 不带树形结构
     * @param navigation
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/getnavigations", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Navigation>> getList(@RequestBody Navigation navigation) throws Exception;

    /**
     * 通过主键删除导航栏,不判断是否有子级
     * @param
     * @throws Exception
     */
    @RequestMapping(value = "/navigation/deleteByPrimarykey", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct deleteByPrimarykey(@RequestBody Long navigationId) throws Exception;

    /**
     * @Description 将分类添加到导航栏
     * @Date 15:59 2018/7/26
     * @Param [navigationId]
     **/
    @RequestMapping(value = "/navigation/saveColumnToNavigation", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct saveColumnToNavigation(@RequestBody Column column) throws Exception;
}
